package com.jinzhi.jzapi.training.controller;

import com.jinzhi.common.annotation.Log;
import com.jinzhi.common.base.BaseController;
import com.jinzhi.common.service.DictService;
import com.jinzhi.common.utils.ApiResult;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/jzApi/traIndex")
public class ApiTraIndexController extends BaseController {

    @Autowired
    private DictService dictService;


    /**
     * api小程序端-banner图信息接口--公开方法，不需要登录
     *
     * @Description: 首页banner信息查询
     * @Param: []
     * @return: com.jinzhi.common.utils.ApiResult<?>
     * @Author: kl
     * @Date: 2020-04-21
     */
    @GetMapping("/selBanners")
    @Log("api小程序端-banner图信息接口")
    @ApiOperation(value = "api小程序端-banner图信息接口", httpMethod = "GET", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @Transactional
    public ApiResult<?> selBanners() {
        Map<String, String> map = new HashMap<>();
        map.put("name", "培训小程序banner图");
        map.put("type", "tra_banners");
        List<Map> maps = dictService.selTypeNameVue(map);
        return ApiResult.success(maps);
    }


}
